package remote.controls
{
	import flash.text.TextFieldType;
	
	import remote.skins.SolidRectangleSkin;
	
	/**
	 * 单行文本框
	 * @author 银魂飞雪
	 * @createDate 2011-4-4
	 */
	public class TextInput extends Label
	{
		private var _displayAsPassword:Boolean;
		public function TextInput()
		{
			super();
			this.textField.selectable = true;
			this.textField.type = TextFieldType.INPUT;
		}
		
		/**
		 * @inheritDoc 
		 * 
		 */
		override protected function createSkin():void
		{
			_skin = new SolidRectangleSkin();
		}
		
		public function get editable():Boolean
		{
			return textField.type == TextFieldType.INPUT;
		}
		
		public function set editable(value:Boolean):void
		{
			if(editable != value)
			{
				textField.type = (value? TextFieldType.INPUT : TextFieldType.DYNAMIC);
			}
		}
	}
}